<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>WMTS 图层</title>
    <script type="text/javascript" src="../../dist/include-openlayers.js"></script>
</head>
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%">
<div id="map" style="width: 100%;height:100%"></div>
<script type="text/javascript">
    var resolutions = new Array(17);
    var matrixIds = new Array(17);
    for (var z = 0; z < 17; ++z) {
        resolutions[z] = 156543.033928041 / Math.pow(2, z);
        matrixIds[z] = z;
    }
    var map = new ol.Map({
        target: 'map',
        controls: ol.control.defaults({attributionOptions: {collapsed: false}})
            .extend([new ol.supermap.control.Logo()]),
        view: new ol.View({
            center: [0, 0],
            zoom: 0,
        }),
        layers: [new ol.layer.Tile({
            opacity: 0.7,
            source: new ol.source.TileWMS({
                url: (window.isLocal ? document.location.protocol + "//" + document.location.host : "http://support.supermap.com.cn:8090")+"/iserver/services/map-china400/wms111/China",
                params: {
                    'LAYERS': 'China',
                    'FORMAT': 'image/png'
                },
                attributions: new ol.Attribution({
                    html: "Map Data <span>© <a href='http://support.supermap.com.cn/product/iServer.aspx' target='_blank'>SuperMap iServer</a></span> with <span>© <a href='http://iclient.supermapol.com' target='_blank'>SuperMap iClient</a></span>"
                })
            }),

        })]
    });
</script>
</body>
</html>